<?php

namespace app\admin\model;

use think\Model;


class ClothmakingOrders extends Model
{





    // 表名
    protected $name = 'clothmaking_orders';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'name',
        'outbound_status_text',
        'customer_demand_quantity'
    ];


    
    public function getOutboundStatusList()
    {
        return ['已出库' => __('已出库'), '未出库' => __('未出库'), '部分出库' => __('部分出库')];
    }

    public function getOutboundStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['outbound_status']) ? $data['outbound_status'] : '');
        $list = $this->getOutboundStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


}
